from django.contrib import admin
from django.urls import path, re_path

from .views import (
    CreateLabLogView,
    UpdateLabLogView,
    LabLogListView,
    LabLogDetailView,
    bulk_create_schedule_by_month,
    show_schedule_by_month,
    ajax_server_now)

urlpatterns = [
    re_path(r'^lablog/create/(?P<date>[0-9]{4}[0-9]{2}[0-9]{2})/(?P<slot>[1|2]{1})/$',
            CreateLabLogView.as_view(), name='create_lablog'),
    re_path(r'^lablog/update/(?P<date>[0-9]{4}[0-9]{2}[0-9]{2})/(?P<slot>[1|2]{1})/$',
            UpdateLabLogView.as_view(), name='update_lablog'),
    path('lablog/list/', LabLogListView.as_view(), name='lablog_list'),
    path('lablog/detail/<int:pk>/', LabLogDetailView.as_view(), name='lablog_detail'),
    path('schedule/create/<int:year>/<int:month>/', bulk_create_schedule_by_month, name='create_schedule'),
    path('schedule/show/<int:year>/<int:month>/', show_schedule_by_month, name='show_schedule'),
    path('ajax/server_now/', ajax_server_now, name='ajax_server_now')
]
